home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / King of Skeleton / King of Skeleton.swf / scripts / __Packages / LineIndicator.as < prev    next >
Encoding:
Text File  |  2006-02-02  |  1.3 KB  |  55 lines

  1. class LineIndicator extends MovieClip
  2. {
  3.    var ts;
  4.    var it = 0;
  5.    var ia = 0;
  6.    var ta = 0;
  7.    static var et = 300;
  8.    static var iac = 21.991148575128552;
  9.    function LineIndicator()
  10.    {
  11.       super();
  12.       this._visible = true;
  13.    }
  14.    function update(s, pv)
  15.    {
  16.       this.ts = this.ts != undefined ? this.ts : s;
  17.       if(this.ts != s)
  18.       {
  19.          this.ts = s;
  20.          if(!this.ts.s)
  21.          {
  22.             var _loc3_ = pv / Vars.tVel;
  23.             this.ta = LineIndicator.iac / this.ts.r * Trig.rd * this.ts.d * Math.sin(_loc3_ * 1.5707963267948966);
  24.          }
  25.          else
  26.          {
  27.             this.ta = 0;
  28.          }
  29.          this.ia = this._rotation;
  30.          this.it = getTimer();
  31.       }
  32.       if(getTimer() > this.it + LineIndicator.et)
  33.       {
  34.          this._rotation = this.ta;
  35.       }
  36.       else
  37.       {
  38.          this._rotation = Sine.easeInOut(getTimer() - this.it,this.ia,this.ta - this.ia,LineIndicator.et);
  39.       }
  40.       return this._rotation;
  41.    }
  42.    function findta(pv)
  43.    {
  44.       if(this.ts.s)
  45.       {
  46.          this.ta = 0;
  47.       }
  48.       else
  49.       {
  50.          var _loc2_ = pv / Vars.tVel;
  51.          this.ta = LineIndicator.iac / this.ts.r * Trig.rd * this.ts.d * Math.sin(_loc2_ * 1.5707963267948966);
  52.       }
  53.    }
  54. }
  55.